package com.zhss.ddd.order.api;

import com.zhss.ddd.order.application.service.OrderApplicationService;
import com.zhss.ddd.order.domain.model.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户界面（对外提供的API接口）
 */
@RestController
@RequestMapping("/order")
public class OrderApi {

    /**
     * 订单应用服务
     */
    @Autowired
    private OrderApplicationService orderApplicationService;

    /**
     * 对外提供的创建订单的接口
     * @return
     */
    @PostMapping("/create")
    public String create(Order order) {
        try {

        } catch(Exception e) {
            e.printStackTrace();
            return "failure";
        }

        return "success";
    }

}
